package com.fanqiechaodan.bridge;

/**
 * @author fanqiechaodan
 * @Classname Demo
 * @Description 桥梁模式
 */
public class Demo {

    public static void main(String[] args) {
        // 支付宝支付
        PaymentImplementor paymentImplementor = new AliPaymentImplementor();
        Payment payment = new OnlinePayment(paymentImplementor);
        payment.pay(100);
        System.out.println();
        // 微信支付
        paymentImplementor = new WechatPaymentImplementor();
        payment = new OnlinePayment(paymentImplementor);
        payment.pay(101);
        System.out.println();
        // 银联支付
        paymentImplementor = new UnionpayPaymentImplementor();
        payment = new OnlinePayment(paymentImplementor);
        payment.pay(102);
    }
}
